import 'package:flutter/material.dart';

import '../../../../lib_baseview/lib_baseview.dart';

class UserJoinAnimationWidget extends StatelessWidget {
  // final SimpleChannelUser user;
  const UserJoinAnimationWidget({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Container(
      width: 260,
      height: 48,
      // decoration: BoxDecoration(
      //     // color: Colors.red,
      //     // image: DecorationImage(
      //     //     image: AssetImage(
      //     //       getBgUrl(),
      //     //     ),
      //     //     fit: BoxFit.cover),
      //     ),
      child: Padding(
        padding: const EdgeInsets.only(
          left: 12,
        ),
        child: Row(
          children: [
            CachedNetworkImage(
              imageUrl: "",
              width: 72,
              height: 45.6,
              fit: BoxFit.contain,
              placeholder: (context, url) => Image.asset(
                'assets/images/ic_car_demo.png',
                width: 72,
                height: 45.6,
                fit: BoxFit.contain,
              ),
              errorWidget: (context, url, error) {
                return Image.asset(
                  'assets/images/ic_car_demo.png',
                  width: 72,
                  height: 45.6,
                  fit: BoxFit.contain,
                );
              },
            ),
            const SizedBox(
              width: 5,
            ),
            const Expanded(
              child: Column(
                mainAxisSize: MainAxisSize.min,
                crossAxisAlignment: CrossAxisAlignment.start,
                children: [
                  Row(
                    mainAxisSize: MainAxisSize.min,
                    children: [
                      Flexible(
                        child: Text('removeHideSpace',
                            maxLines: 1,
                            overflow: TextOverflow.ellipsis,
                            style: TextStyle(
                                fontSize: 12,
                                color: Color(0xFFFAC011),
                                fontWeight: FontWeight.w400,
                                height: 1)),
                      ),
                      SizedBox(
                        width: 4,
                      ),
                      Text('sssss'),
                      // SexAgeLabel(
                      //     isMale: user.gender == UserConstants.genderMan,
                      //     age: "${user.age}"),
                      // UserLevWidget(
                      //   vipImgStr: user.vipIcons.middleIcon,
                      // ),
                      // UserKnightWidget(
                      //   imgStr: user.knightIcon,
                      // ),
                    ],
                  ),
                  SizedBox(
                    height: 5,
                  ),
                  Row(
                    mainAxisSize: MainAxisSize.min,
                    children: [
                      Text('current!.drive',
                          style: TextStyle(
                              fontSize: 12,
                              color: Colors.white,
                              fontWeight: FontWeight.w400,
                              height: 1)),
                      Flexible(
                        fit: FlexFit.loose,
                        child: Text('user.car.carMetaInfo.name',
                            style: TextStyle(
                                fontSize: 12,
                                color: Color(0xFFFAC011),
                                fontWeight: FontWeight.w400,
                                height: 1),
                            softWrap: false,
                            overflow: TextOverflow.ellipsis),
                      ),
                      Text('T.current!.people_enter_room',
                          style: TextStyle(
                              fontSize: 12,
                              color: Colors.white,
                              fontWeight: FontWeight.w400,
                              height: 1)),
                    ],
                  ),
                ],
              ),
            ),
          ],
        ),
      ),
    );
  }

  // String getBgUrl() {
  //   if (user.car.carMetaInfo.level == CarLevel.B) {
  //     return "assets/images/bg_room_user_join_b.png";
  //   } else if (user.car.carMetaInfo.level == CarLevel.A) {
  //     return "assets/images/bg_room_user_join_a.png";
  //   } else if (user.car.carMetaInfo.level == CarLevel.S) {
  //     return "assets/images/bg_room_user_join_s.png";
  //   } else if (user.car.carMetaInfo.level == CarLevel.SS) {
  //     return "assets/images/bg_room_user_join_ss.png";
  //   } else if (user.car.carMetaInfo.level == CarLevel.SSS) {
  //     return "assets/images/bg_room_user_join_sss.png";
  //   }
  //   return "assets/images/bg_room_user_join_b.png";
  // }
}
